import request from '@/config/axios'
// 获得计划树
export const getTree = async (params) => {
  return await request.get({ url: '/testplan/plan/tree/'+params.id })
}
// 创建测试计划
export const createPlan = async (data) => {
  return await request.post({ url: '/testplan/plan/create', data })
}
// 更新测试计划
export const updatePlan = async (data) => {
  return await request.put({ url: '/testplan/plan/update', data })
}
// 获得测试计划下拉
export const getPlanList = async (params) => {
  return await request.get({ url: '/testplan/plan/list/'+params.projectId })
}
// 获得测试计划详情
export const getPlanInfo = async (params) => {
  return await request.get({ url: '/testplan/plan/get',params})
}
// 获得用例分页
export const getCaseList = async (params) => {
  return await request.get({ url: '/testplan/plan/cases', params })
}
// 获取用例分页参数有name
export const getCaseListByName = async (params) => {
  return await request.get({ url: '/testplan/plan/caseList', params })
}
// 获得测试人员
export const getTestUserList = async (params) => {
  return await request.get({ url: '/project/member/testers', params })
}
// 获取用例详情
export const getTestCaseInfo = async (params) => {
  return await request.get({ url: '/testplan/plan-case/get', params })
}
// 用例通过
export const successTestCase = async (data) => {
  return await request.put({ url: '/testplan/plan-case/success', data })
}
// 用例失败
export const failTestCase = async (data) => {
  return await request.put({ url: '/testplan/plan-case/failure', data })
}
// 用例锁定
export const lockTestCase = async (data) => {
  return await request.put({ url: '/testplan/plan-case/lock', data })
}
